//
//  ReKindCityView.m
//  TravelToHelp
//
//  Created by lanou3g on 15/10/29.
//  Copyright © 2015年 冯贵宾. All rights reserved.
//

#import "ReKindCityView.h"

@implementation ReKindCityView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _selfHeight = frame.size.height;
        _selfWidth = frame.size.width;
        self.backgroundColor = [UIColor whiteColor];
        [self addSubViews];
    }
    return self;
}

- (void)addSubViews
{
    // button
    _button = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _button.frame = CGRectMake(0, 0, _selfWidth, _selfHeight);
    [self addSubview:_button];
    // 图片
    _imageV = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, _selfWidth - 20, _selfHeight - 20)];
   //  _imageV.backgroundColor = [UIColor yellowColor];
    _imageV.layer.cornerRadius = (_selfHeight - 20) / 2;
    _imageV.layer.masksToBounds = YES;
    [_button addSubview:_imageV];
    
    // 标题
    _label = [[UILabel alloc] initWithFrame:CGRectMake(0, _selfHeight - 15, _selfWidth, 15)];
   // _label.backgroundColor = [UIColor purpleColor];
    _label.textAlignment = NSTextAlignmentCenter;
    _label.font = [UIFont systemFontOfSize:14];
    _label.textColor = [UIColor grayColor];
    [_button addSubview:_label];
    
}

@end
